home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Navig
- BorderStyle = 3 'Fixed Dialog
- Caption = "AddFlow Navigation tests"
- ClientHeight = 5220
- ClientLeft = 1080
- ClientTop = 930
- ClientWidth = 6390
- Height = 5910
- Left = 1020
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5220
- ScaleWidth = 6390
- ShowInTaskbar = 0 'False
- Top = 300
- Width = 6510
- Begin VB.CommandButton Command1
- Caption = "Selected Links"
- Height = 375
- Index = 11
- Left = 4680
- TabIndex = 12
- Top = 4740
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Owned Nodes"
- Height = 375
- Index = 10
- Left = 4680
- TabIndex = 11
- Top = 2640
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Selected Nodes"
- Height = 375
- Index = 9
- Left = 4680
- TabIndex = 10
- Top = 4320
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "All Items"
- Height = 375
- Index = 8
- Left = 4680
- TabIndex = 8
- Top = 3900
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "All Links"
- Height = 375
- Index = 7
- Left = 4680
- TabIndex = 7
- Top = 3480
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "All Nodes"
- Height = 375
- Index = 6
- Left = 4680
- TabIndex = 6
- Top = 3060
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Out Links"
- Height = 375
- Index = 5
- Left = 4680
- TabIndex = 5
- Top = 2220
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "In Links"
- Height = 375
- Index = 4
- Left = 4680
- TabIndex = 4
- Top = 1800
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "In and Out Links"
- Height = 375
- Index = 3
- Left = 4680
- TabIndex = 3
- Top = 1380
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Org Nodes"
- Height = 375
- Index = 2
- Left = 4680
- TabIndex = 2
- Top = 960
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Dst Nodes"
- Height = 375
- Index = 1
- Left = 4680
- TabIndex = 1
- Top = 540
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "In and Out Nodes"
- Height = 375
- Index = 0
- Left = 4680
- TabIndex = 0
- Top = 120
- Width = 1575
- End
- Begin AddFlowLib.AddFlow AddFlow1
- Height = 4215
- Left = 90
- TabIndex = 13
- Top = 900
- Width = 4245
- _Version = 65536
- _ExtentX = 7488
- _ExtentY = 7435
- _StockProps = 101
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- ScrollBars = 3
- Shape = 0
- LinkStyle = 0
- Alignment = 7
- AutoSize = 0
- ArrowDst = 3
- ArrowOrg = 0
- DrawStyle = 0
- DrawWidth = 1,4013e-45
- ReadOnly = 0 'False
- MultiSel = -1 'True
- CanDrawNode = -1 'True
- CanDrawLink = -1 'True
- CanMoveNode = -1 'True
- CanSizeNode = -1 'True
- CanStretchLink = -1 'True
- CanMultiLink = -1 'True
- Transparent = 0 'False
- ShowGrid = 0 'False
- Hidden = 0 'False
- Rigid = 0 'False
- DisplayHandles = -1 'True
- AutoScroll = -1 'True
- xGrid = 7,00649e-45
- yGrid = 7,00649e-45
- xZoom = 100
- yZoom = 100
- FillColor = 16777215
- DrawColor = 0
- ForeColor = 0
- BackPicture = "navig.frx":0000
- End
- Begin VB.Label Label1
- Caption = $"navig.frx":001C
- ForeColor = &H00FF0000&
- Height = 615
- Left = 90
- TabIndex = 9
- Top = 210
- Width = 4335
- End
- Begin VB.Menu FileMenu
- Caption = "&File"
- Begin VB.Menu ExitMenu
- Caption = "&Exit"
- End
- End
- Begin VB.Menu HelpMenu
- Caption = "&?"
- Begin VB.Menu AboutMenu
- Caption = "&About..."
- End
- End
- Attribute VB_Name = "Navig"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub AboutMenu_Click()
- MsgBox "AddFlow: navigation methods sample" + Chr(13) + "Copyright
- 1997 Lassalle Technologies"
- End Sub
- Private Sub Command1_Click(Index As Integer)
- Dim nodx As afNode, lnkx As afLink
- With AddFlow1
- ' Reset draw color of every items (nodes and links)
- For Each nodx In .Nodes
- nodx.DrawColor = RGB(0, 0, 0)
- For Each lnkx In nodx.OutLinks
- lnkx.DrawColor = RGB(0, 0, 0)
- Next
- Next
- ' Change draw color of various collections of items
- Select Case Index
- Case 0
- For Each lnkx In .Nodes(1).OutLinks
- If lnkx.Rigid = False Then
- lnkx.Dst.DrawColor = RGB(255, 0, 0)
- End If
- Next
- For Each lnkx In .Nodes(1).InLinks
- If lnkx.Rigid = False Then
- lnkx.Org.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 1
- For Each lnkx In .Nodes(1).OutLinks
- If lnkx.Rigid = False Then
- lnkx.Dst.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 2
- For Each lnkx In .Nodes(1).InLinks
- If lnkx.Rigid = False Then
- lnkx.Org.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 3
- For Each lnkx In .Nodes(1).OutLinks
- If lnkx.Rigid = False Then
- lnkx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- For Each lnkx In .Nodes(1).InLinks
- If lnkx.Rigid = False Then
- lnkx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 4
- For Each lnkx In .Nodes(1).InLinks
- If lnkx.Rigid = False Then
- lnkx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 5
- For Each lnkx In .Nodes(1).OutLinks
- If lnkx.Rigid = False Then
- lnkx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 6 ' All nodes
- For Each nodx In .Nodes
- nodx.DrawColor = RGB(255, 0, 0)
- Next
- Case 7 ' All links
- For Each nodx In .Nodes
- For Each lnkx In nodx.OutLinks
- lnkx.DrawColor = RGB(255, 0, 0)
- Next
- Next
- Case 8 ' All nodes and links
- For Each nodx In .Nodes
- nodx.DrawColor = RGB(255, 0, 0)
- For Each lnkx In nodx.OutLinks
- lnkx.DrawColor = RGB(255, 0, 0)
- Next
- Next
- Case 9 ' Selected nodes
- For Each nodx In .Nodes
- If nodx.Selected = True Then
- nodx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 10 ' Owned nodes
- For Each lnkx In .Nodes(1).OutLinks
- If lnkx.Rigid = True Then
- lnkx.Dst.DrawColor = RGB(255, 0, 0)
- End If
- Next
- Case 11 ' Selected links
- For Each nodx In .Nodes
- If nodx.Selected = True Then
- For Each lnkx In nodx.OutLinks
- If lnkx.Selected = True Then
- lnkx.DrawColor = RGB(255, 0, 0)
- End If
- Next
- End If
- Next
- End Select
- End With
- End Sub
- Private Sub ExitMenu_Click()
- End
- End Sub
- Private Sub Form_Load()
- With AddFlow1
- Dim nodx As afNode, lnkx As afLink
- Set nodx = .Nodes.Add(1050, 1050, 525, 375)
- nodx.Text = "1"
- nodx.Shape = afRectangle
- nodx.FillColor = &HC0FFFF
- Set nodx = .Nodes.Add(1350, 75, 525, 370)
- nodx.Text = "2"
- Set nodx = .Nodes.Add(1950, 675, 600, 300)
- nodx.Text = "3"
- Set nodx = .Nodes.Add(2350, 1200, 500, 500)
- nodx.Text = "4"
- Set nodx = .Nodes.Add(150, 1725, 825, 750)
- nodx.Text = "5: owned by 1"
- Set nodx = .Nodes.Add(225, 300, 500, 500)
- nodx.Text = "6"
- Set nodx = .Nodes.Add(1250, 2800, 500, 500)
- nodx.Text = "7"
- Set nodx = .Nodes.Add(2750, 2000, 825, 750)
- nodx.Text = "8: owned by 1"
- Set nodx = .Nodes.Add(2000, 3100, 825, 750)
- nodx.Text = "9: owned by 8"
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(3))
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(6))
- Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(1))
- Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(1))
- Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(7))
- Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(1))
- Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(8))
- ' Links that allow ownership beteen nodes
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(5))
- lnkx.Hidden = True
- lnkx.Rigid = True
- lnkx.Selectable = False
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(8))
- lnkx.Hidden = True
- lnkx.Rigid = True
- lnkx.Selectable = False
- Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(9))
- lnkx.Hidden = True
- lnkx.Rigid = True
- lnkx.Selectable = False
- End With
- End Sub
-